home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Amiga-E / E_v3.2a / Src / Gfx / 24bitColourDemo.e next >
Text File  |  1992-09-02  |  2KB  |  47 lines

  1. /* 24bit color demo. works only on AGA machines with kick3 
  2.  
  3. A small demo demonstrating the new 24bit palette of the newer AA
  4. Amigas. You'll need such an amiga and kick3 to run this demo, ofcourse.
  5. The demo will draw lines in 256 tints and less on the screen, and then
  6. lets you manipulate the colour-registers by pressing the leftMB on some
  7. (x,y) spot on the screen. These coordinates will serve as RGB values.
  8. To quit, press the rightMB.
  9.  
  10. */
  11.  
  12. OPT OSVERSION=39
  13.  
  14. CONST X=319, Y=255
  15.  
  16. PROC main()
  17.   DEF s,win,x,y,z
  18.   IF s:=OpenS(X+1,Y+1,8,0,'bla')
  19.     IF win:=OpenW(0,0,X+1,Y+1,0,0,'bla',s,15,0)
  20.       FOR x:=0 TO 255 DO SetColour(s,x,x,x,x)
  21.       FOR y:=0 TO Y DO Line(0,y,63,y,y AND $FF)
  22.       FOR y:=0 TO Y DO Line(64,y,127,y,y AND $FE)
  23.       FOR y:=0 TO Y DO Line(128,y,191,y,y AND $FC)
  24.       FOR y:=0 TO Y DO Line(192,y,255,y,y AND $F8)
  25.       FOR y:=0 TO Y DO Line(256,y,319,y,y AND $F0)
  26.       SetDrMd(stdrast,0)
  27.       SetTopaz(8)
  28.       TextF(0,30,' Press leftMB on some (x,y) spot')
  29.       TextF(0,40,' Press (0,0) to leave.')
  30.       TextF(0,50,' #of colours:')
  31.       TextF(0,60,'   256     128     64      32      16   ')
  32.       TextF(0,70,' #bits colour:')
  33.       TextF(0,80,'   24      21      18      15      12   ')
  34.       TextF(0,90,'   AGA     AGA     AGA     AGA     ECS  ')
  35.       WHILE TRUE
  36.         WaitLeftMouse(win)
  37.         y:=MouseX(win)*4/5
  38.         z:=MouseY(win)
  39.       EXIT y+z<4
  40.         FOR x:=0 TO 255 DO SetColour(s,x,y,x,z)
  41.       ENDWHILE
  42.       CloseW(win)
  43.     ENDIF
  44.     CloseS(s)
  45.   ENDIF
  46. ENDPROC
  47.